package com.zjitc;

import java.sql.Connection;
import java.sql.SQLException;
import javax.sql.DataSource;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Hello world!
 *
 */
public class App1
{
    public static void main( String[] args )
    {
      //数据库连接
      ApplicationContext context=new AnnotationConfigApplicationContext(DataSourceConfiguration.class);
      DataSource ds=context.getBean(DataSource.class);

        try {
          Connection conn=ds.getConnection();
          System.out.println(conn);
        } catch (SQLException e) {
          e.printStackTrace();
        }


    }
}
